home *** CD-ROM | disk | FTP | other *** search
/ PCNet 2006 April / PCnet 2006-06.4.iso / toolkit / MP10Setup.exe / wmploc.DLL / 256 / 4003 < prev    next >
Encoding:
Text File  |  2005-01-28  |  6.2 KB  |  132 lines

  1.  ■//<script>
  2. // Windows Media Player - Copyright 2000 Microsoft Corporation.
  3. function InitOCXSkin()
  4. {
  5.     InitVisualizations();
  6.     // IE Bug:  We do this so that we don't have to change the size synchronously
  7.     //          from the OnLoad event...
  8.     svLayoutSize.moveTo( svLayoutSize.left, svLayoutSize.top, 10 );
  9. }
  10. function InitVisualizations()
  11. {
  12.     if (osMediaOpen == player.OpenState)
  13.     {
  14.         if (player.currentMedia.ImageSourceWidth > 0)
  15.         {
  16.             svVisual.visible=false;
  17.             svVideo.visible=true;
  18.         } 
  19.         else 
  20.         { 
  21.             svVideo.visible=false;
  22.             svVisual.visible=mediacenter.showEffects;
  23.         }
  24.     }
  25.     else 
  26.     { 
  27.         svVideo.visible=false;
  28.         svVisual.visible=false;
  29.     }
  30. }
  31. function OnPlayStateChangeViz()
  32. {
  33.     InitVisualizations();
  34.     AutoSize();
  35. }
  36. function OnOpenStateChangeViz()
  37. {
  38.     OnPlayStateChangeViz();
  39. }
  40. function AutoSize()
  41. {
  42.     if (osMediaOpen == player.OpenState)
  43.     {
  44.         if (player.currentMedia.ImageSourceWidth > 0)
  45.         {
  46.             // Resize layout to match the video size
  47.             view.height = player.currentMedia.ImageSourceHeight + svTransport.height + svBanner.height;
  48.             
  49.             // clip to the transport controls width
  50.             if ((0 == svTransport.width) || (player.currentMedia.ImageSourceWidth > svLayoutSize.width))
  51.             {
  52.                 view.width = player.currentMedia.ImageSourceWidth;
  53.             }
  54.             else
  55.             {
  56.                 view.width = svLayoutSize.width;
  57.             }
  58.         }
  59.         else
  60.         {
  61.             // Resize layout to original size
  62.             view.width = svLayoutSize.width;        
  63.             view.height = svLayoutSize.height;
  64.         }
  65.     }
  66. }
  67. function CheckForAdBanner(media)
  68. {   
  69.     var oldHeight = svBanner.height;
  70.     if (media.getItemInfo('BannerURL') != '')
  71.     {
  72.         AdBanner.image="WMPImage_AdBanner";
  73.         svBanner.height=AdBanner.height;
  74.         AdBanner.tabStop=true;
  75.     AdBanner.uptoolTip=media.getItemInfo('BannerAbstract');;
  76.     }
  77.      
  78.     else
  79.     {
  80.         svBanner.height=0;
  81.         AdBanner.tabStop=false;
  82.     }
  83.     if (svBanner.height!=oldHeight)
  84.     {    
  85.         svVideo.height  = view.height - svTransport.height - svBanner.height; 
  86.         svVisual.height = view.height - svTransport.height - svBanner.height;
  87.         svBanner.top    = svVideo.top + svVideo.height;
  88.     }
  89. }
  90. function OnBannerClick()
  91. {
  92.     if (player.openState==osMediaOpen)
  93.     {
  94.         var strTargetURL = player.currentmedia.getItemInfo("BannerInfoURL");
  95.         if ( strTargetURL != "")
  96.         {
  97.             var strBannerTarget = player.currentmedia.getItemInfo("BannerInfoTarget");
  98.             if ( strBannerTarget != "")
  99.             {
  100.                 strTargetURL = strTargetURL + "&&" + strBannerTarget;
  101.             }
  102.             
  103.             player.launchURL(strTargetURL);   
  104.         }
  105.     }
  106. }
  107. function OnBannerMouseOver()
  108. {
  109.     if (player.openState==osMediaOpen)
  110.     {
  111.         if ( player.currentmedia.getItemInfo("BannerInfoURL") != "")
  112.         {
  113.             AdBanner.cursor = "hand";
  114.         }
  115.         else
  116.         {
  117.             AdBanner.cursor = "system";
  118.         }
  119.     }
  120. }